package com.fl.boot.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/*
  Author: FL
  Date: 2024/2/15 9:14
 */

/**
 * @code 1 成功 , 0 失败
 * @msg 提示信息
 * @data 数据 date
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {//统一响应结果封装类
    private Integer code ;
    private String msg;
    private Object data;

    public static Result success(){
        return new Result(1, "success", null);
    }
    public static Result success(Object data){
        return new Result(1, "success", data);
    }
    //失败返回
    public static Result error(String msg){
        return new Result(0, msg, null);
    }
}
